﻿Imports Crystal.CLL

Public Class NewColumnManager
#Region "Enum"
    Public Enum ColumnDataSource
        CmbSourceName
        GrdSourceName
    End Enum

#End Region

#Region "Methods"
    Public Function GetColumnSourceType() As DataTable
        Return DataFactory.CreateDataBase().ExecuteDataSet("CR_sp_DE_GetColumnSourceType").Tables(0)
    End Function

    Public Function GetColumnDataSource(ByVal pstrSourceTypeCode As String, ByVal pintProjectID As Integer, ByVal pblnIsEList As Boolean) As DataSet
        Return DataFactory.CreateDataBase().ExecuteDataSet("CR_sp_DE_GetColumnDataSource", New Object() {pstrSourceTypeCode, pintProjectID, pblnIsEList})
    End Function

    Public Function GetProjectListing(ByVal pintProjectID As Integer) As DataTable
        Return DataFactory.CreateDataBase().ExecuteDataSet("CR_sp_DE_GetColumnListings", {pintProjectID}).Tables(0)
    End Function

    Public Function InsertNewColumn(ByVal pstrColumnTitle As String, ByVal pintESourceID As Integer, ByVal pintProjectID As Integer, ByVal pintUserID As Integer, ByVal pblnFL As Boolean, ByVal pdtSourceDate As Date) As Integer
        Return DataFactory.CreateDataBase().ExecuteScalar("CR_sp_DH_InsertNewColumn", {pstrColumnTitle, pintESourceID, pintProjectID, pintUserID, pblnFL, If(pdtSourceDate = "#1/1/1900#", DBNull.Value, pdtSourceDate)})
    End Function
#End Region
End Class
